return do_evtchn_op(xch, EVTCHNOP_status, status,
sizeof(*status), 1);
}
+
+int xc_evtchn_fd(xc_evtchn *xce)
+{
+ return xce->ops->u.evtchn.fd(xce, xce->ops_handle);
+}
return close(fd);
}
-int xc_evtchn_fd(xc_evtchn *xce)
+static int linux_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
{
- return xce->fd;
+ return (int)h;
}
int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
static struct xc_osdep_ops linux_evtchn_ops = {
.open = &linux_evtchn_open,
.close = &linux_evtchn_close,
+
+ .u.evtchn = {
+ .fd = &linux_evtchn_fd,
+ },
};
/* Optionally flush file to disk and discard page cache */
files[fd].type = FTYPE_NONE;
}
-int xc_evtchn_fd(xc_evtchn *xce)
+static int minios_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
{
- return xce->fd;
+ return (int)h;
}
int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
static struct xc_osdep_ops minios_evtchn_ops = {
.open = &minios_evtchn_open,
.close = &minios_evtchn_close,
+
+ .u.evtchn = {
+ .fd = &minios_evtchn_fd,
+ },
};
/* Optionally flush file to disk and discard page cache */
return close(fd);
}
-int xc_evtchn_fd(xc_evtchn *xce)
+static int netbsd_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
{
- return xce->fd;
+ return (int)h;
}
int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
static struct xc_osdep_ops netbsd_evtchn_ops = {
.open = &netbsd_evtchn_open,
.close = &netbsd_evtchn_close,
+
+ .u.evtchn = {
+ .fd = &netbsd_evtchn_fd,
+ },
};
/* Optionally flush file to disk and discard page cache */
return close(fd);
}
-int xc_evtchn_fd(xc_evtchn *xce)
+static int solaris_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
{
- return xce->fd;
+ return (int)h;
}
int xc_evtchn_notify(xc_evtchn *xce, evtchn_port_t port)
static struct xc_osdep_ops solaris_evtchn_ops = {
.open = &solaris_evtchn_open,
.close = &solaris_evtchn_close,
+
+ .u.evtchn = {
+ .fd = &solaris_evtchn_fd,
+ },
};
/* Optionally flush file to disk and discard page cache */
size_t chunksize, privcmd_mmap_entry_t entries[],
int nentries);
} privcmd;
+ struct {
+ int (*fd)(xc_evtchn *xce, xc_osdep_handle h);
+ } evtchn;
} u;
};
typedef struct xc_osdep_ops xc_osdep_ops;